//
//  GZConst.m
//  Gunz
//
//  Created by Joggy on 16/1/18.
//  Copyright © 2016年 NUPT. All rights reserved.
//

#import "GZConst.h"

@implementation GZConst

+(CGFloat)getScreenWidth {      //获取屏幕宽度
    return [UIScreen mainScreen].bounds.size.width;
}

+(CGFloat)getScreenHeight {     //获取屏幕高度
    return [UIScreen mainScreen].bounds.size.height;
}

+(CGFloat)getScreenProportion {
    return [self getScreenWidth]/320;
}

+(BOOL)isFileExist:(NSString *)path {
    NSFileManager *manager = [NSFileManager defaultManager];
    return [manager fileExistsAtPath:path];
}

//+(void)delay:(double)time with:(block)event {
//    dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(time*NSEC_PER_SEC));
//    dispatch_after(popTime, dispatch_get_main_queue(), event);
//}
+(void)delay:(double)time with:(void (^)(void))event {
    dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(time*NSEC_PER_SEC));
    dispatch_after(popTime, dispatch_get_main_queue(), event);
}

+(NSString*)getCurrentDateFormate {
    NSDate *date = [NSDate date];
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateFormat:@"YYYY-MM-dd-HH-mm-ss"];
    return [formatter stringFromDate:date];
}

+ (NSArray*)defaultData {
    
    NSArray* array = @[
                       @{
                           @"icontask": @"__no",
                           @"name": @"南京本地话语音采集",
                           @"describe": @"采集南京本地话",
                           @"faretask": @"16",
                           @"station": @"0",
                           @"fields": @{
                                   @"icontask": @"__no",
                                   @"name": @"南京本地话语音采集",
                                   @"faretask": @"16",
                                   @"ownuser": @"简果公司",
                                   @"starttime": @"2016",
                                   @"overtime": @"2016",
                                   @"describe": @"采集南京本地话",
                                   @"templete": @"无"
                                   }
                           },
                       @{
                           @"icontask": @"__no",
                           @"name": @"南京本地话语音采集",
                           @"describe": @"采集南京本地话",
                           @"faretask": @"16",
                           @"station": @"1",
                           @"fields": @{
                                   @"icontask": @"__no",
                                   @"name": @"南京本地话语音采集",
                                   @"faretask": @"16",
                                   @"ownuser": @"简果公司",
                                   @"starttime": @"2016",
                                   @"overtime": @"2016",
                                   @"describe": @"采集南京本地话",
                                   @"templete": @"无"
                                   }
                           },
                       @{
                           @"icontask": @"__no",
                           @"name": @"南京本地话语音采集",
                           @"describe": @"采集南京本地话",
                           @"faretask": @"16",
                           @"station": @"2",
                           @"fields": @{
                                   @"icontask": @"__no",
                                   @"name": @"南京本地话语音采集",
                                   @"faretask": @"16",
                                   @"ownuser": @"简果公司",
                                   @"starttime": @"2016",
                                   @"overtime": @"2016",
                                   @"describe": @"采集南京本地话",
                                   @"templete": @"无"
                                   }
                           }
                       ];
    
    return array;
}

+ (NSArray*)defaultExcutingData {
    NSArray *array = @[
                       @{
                           @"icontask": @"__no",
                           @"name": @"超市采购数据采集",
                           @"station": @"0",
                           @"jointime": @"2016.5.16",
                           @"endtime": @"2016.5.16",
                           @"id": @"0",
                           @"fields": @{
                                   @"icontask": @"__no",
                                   @"name": @"超市采购数据采集",
                                   @"faretask": @"16",
                                   @"ownuser": @"简果公司",
                                   @"starttime": @"2016",
                                   @"overtime": @"2016",
                                   @"describe": @"采集南京本地话",
                                   @"templete": @"无"
                                   }
                           },
                       @{
                           @"icontask": @"__no",
                           @"name": @"南京本地化语音",
                           @"station": @"1",
                           @"jointime": @"2016.7.8",
                           @"endtime": @"2016.7.18",
                           @"id": @"1",
                           @"fields": @{
                                   @"icontask": @"__no",
                                   @"name": @"南京本地化语音",
                                   @"faretask": @"16",
                                   @"ownuser": @"简果公司",
                                   @"starttime": @"2016",
                                   @"overtime": @"2016",
                                   @"describe": @"采集南京本地话",
                                   @"templete": @"无"
                                   }
                           },
                       @{
                           @"icontask": @"__no",
                           @"name": @"各地气温",
                           @"station": @"2",
                           @"jointime": @"2016.5.16",
                           @"endtime": @"2016.5.16",
                           @"id": @"2",
                           @"fields": @{
                                   @"icontask": @"__no",
                                   @"name": @"各地气温",
                                   @"faretask": @"16",
                                   @"ownuser": @"简果公司",
                                   @"starttime": @"2016",
                                   @"overtime": @"2016",
                                   @"describe": @"采集南京本地话",
                                   @"templete": @"无"
                                   }
                           }
                       ];
    return array;
}

+(NSDictionary*)defaultUploadData {
//    {"status": "success", "msg": {"faretask": null, "name": " \u6536\u96c6\u5317\u4eac\u8bdd", "icontask": "task/demo.jpg", "describe": "\u6536\u96c6\u5317\u4eac\u7684\u65b9\u8a00", "taskid": null, "jointime": "2016-03-16T10:52:17Z"}}
    NSDictionary *dic = @{
                          @"faretask": @"",
                          @"name": @"简果发布",
                          @"icontask": @"__no",
                          @"describe": @"采集数据",
                          @"taskid": @"2162423",
                          @"jointime": @"2016-03-57"
                          };
    return dic;
}

+(NSArray*)getDataPathList {
    return @[GZUserLightPath, GZUserQuestionPath, GZUserAudioPath, GZUserVideoPath, GZUserImagePath];
}

@end




